import os

write_file = '/home/sean/data/MOT/2DMOT2015/ImageSet/train15_17.txt'
file_15 = '/home/sean/data/MOT/2DMOT2015/ImageSet/train.txt'
file_17 = '/home/sean/data/MOT/MOT17Det/ImageSet/train.txt'

with open(write_file, 'w') as wf:
    for line in open(file_15, 'r'):
        print(line)
        wf.write(line)
    for line in open(file_17, 'r'):
        line_split = line.split(' ')[0]
        if line_split not in ['train/MOT17-02', 'train/MOT17-05', 'train/MOT17-09', 'train/MOT17-10']:
            write_line = '../MOT17Det/'+line
            print(write_line)
            wf.write(write_line)
